import VueRouter from 'vue-router'

// 导入对应的路由组件
import Pghome from './components/pages/PGhome.vue'
import Pgmemeber from './components/pages/PGmember.vue'
import Pgsearch from './components/pages/PGsearch.vue'
import Pgshopcar from './components/pages/PGshopcar.vue'
import Newslist from './components/news/Newslist.vue'
import NewsInfo from './components/news/NewsInfo.vue'
// 3. 创建路由对象
var router = new VueRouter({
    routes:[  
        {path:'/',redirect:'/home'},
       {path:'/home',component:Pghome},
       {path:'/member',component:Pgmemeber},
       {path:'/search',component:Pgsearch},
       {path:'/shopcar',component:Pgshopcar},
       {path:'/home/newslist',component:Newslist},
       {path:'/home/NewsInfo/:id',component:NewsInfo}
    ],
    linkActiveClass:'mui-active'
})

// 把路由对象暴露出去
export default router